<!-- 清理日志弹窗 -->
<script lang="ts" setup>
import { reactive, ref } from 'vue'

// 是否显示弹窗
const showDialog = ref(false)
// 弹窗数据
const dialogData = reactive({
  title: '',
  content: ''
})

/**
 * 打开弹窗并初始化数据
 */
function init(title: string, content: string) {
  dialogData.title = title
  dialogData.content = content
  showDialog.value = true
}

defineExpose({
  init
})
</script>

<template>
  <dui-dialog v-model="showDialog" :title="dialogData.title">
    <div v-html="dialogData.content"></div>
    <template #footer>
      <el-button @click="showDialog = false">关闭</el-button>
    </template>
  </dui-dialog>
</template>
